<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="f"%>
<%@ taglib uri="/mytag" prefix="yjd"%>
<div class="wrap" >
    <div class="h_a">搜索</div>
    <form
            action="${requestScope.FPWEB.rootPath }/org/all${requestScope.FPWEB.urlStuff}"
            method="get" autocomplete="off">
        <div class="search_type cc">
            <label>机构名称：</label><input name="org_name_like" type="text"
                                     class="input length_3 mr10" value="${maps.org_name_like}"
                                     placeholder="机构名">
            <button type="submit" class="btn btn_submit length_1">搜索</button>
            <button type="button" class="btn  length_2" onclick="window.location.href='${requestScope.FPWEB.rootPath }/org/add${requestScope.FPWEB.urlStuff}'">发布新机构</button>
        </div>
    </form>
    <div class="table_list">
        <c:set var="hashData"
               value="${models!=null && fn:length(models)>1 }" />
        <table width="100%">
            <thead>
            <tr>
                <td>机构ID</td>
                <td>机构名称</td>
                <td>机构电话</td>
                <td>主营项目</td>
                <td>机构地址</td>
                <td>商户类型</td>
                <td>是否启用</td>
                <td>是否推广</td>
                <td>添加时间</td>
                <td>最后更新时间</td>
                <td>操作</td>
            </tr>
            </thead>
            <tbody id="J_word_list">
            <c:forEach items="${pager.pagerModel.dataList }" var="item" varStatus="i">
                <tr>
                    <td>${item.org_id}</td>
                    <td>${item.org_name}</td>
                    <td>${item.org_tel_number}</td>
                    <td>${item.org_major_business}</td>
                    <td>${item.strMap.address}</td>
                    <td>
                        <c:if test="${item.org_mold==1}">普通</c:if>
                        <c:if test="${item.org_mold==2}">VIP</c:if>
                    </td>
                    <td>
                        <c:if test="${item.is_used==0}">否</c:if>
                        <c:if test="${item.is_used==1}">是</c:if>
                    </td>
                    <td>
                        <c:if test="${item.is_spread==0}">否</c:if>
                        <c:if test="${item.is_spread==1}">是</c:if>
                    </td>
                    <td>${item.strMap.create_time}</td>
                    <td>${item.strMap.last_update_time}</td>
                    <td>
                        <a class="btn btn_submit btn_orange" href="${requestScope.FPWEB.rootPath }/org/edit${requestScope.FPWEB.urlStuff}?id=${item.org_id}">修改</a>
                        <c:if test="${item.is_used==0}">
                            <a class="btn btn_submit J_ajax_del" href="${requestScope.FPWEB.rootPath }/org/open${requestScope.FPWEB.urlStuff}?id=${item.org_id}" data-msg="确定开启">开启</a>
                        </c:if>
                        <c:if test="${item.is_used==1}">
                            <a class="btn btn_submit J_ajax_del" href="${requestScope.FPWEB.rootPath }/org/close${requestScope.FPWEB.urlStuff}?id=${item.org_id}"  data-msg="确定禁用">禁用</a>
                        </c:if>
                    </td>
                </tr>
            </c:forEach>
            </tbody>
        </table>
    </div>
    <!-- 分页 -->
    <%@ include file="../public/pager/pager.pagination.jsp" %>
</div>
